import { ObjCreate } from "../common/ObjCreate";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../resource/ImagesConst";
import { BaseItem } from "../common/BaseItem";
import { ItemData } from "../../resource/info/ItemData";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { Language } from "../../../../extend/language/Language";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { EffectManager } from "../../manager/EffectManager";
type int = number;
//class WuXingGradeUpItem
    
    export  class WuXingGradeUpItem /* flash.display.Sprite */
    {
        constructor(arg1: Boolean=false)
        {
            
            this._cur = arg1;
            this.initUI();
            return;
        }

        protected initUI(): void
        {
            this._valueBody = new Object /* flash.display.Sprite */();
            this._valueBody.mouseEnabled = false;
            addChild(this._valueBody);
            this._titleTxt = ObjCreate.createTextField("", 0, 0, 100, 20, this._valueBody);
            this._titleTxt.mouseEnabled = false;
            this._valueTxt = ObjCreate.createTextField("", 0, 16, 120, 20, this._valueBody);
            this._valueTxt.mouseEnabled = false;
            this._itemBg = GlobalClass.getBitmap(ImagesConst.equipment_boarder);
            this._itemBg.x = 0;
            this._itemBg.y = 36;
            addChild(this._itemBg);
            this._itemBase = new BaseItem();
            this._itemBase.setSize(32, 32);
            this._itemBase.x = this._itemBg.x + 10;
            this._itemBase.y = this._itemBg.y + 10;
            this._itemBase.isDragAble = false;
            addChild(this._itemBase);
            return;
        }

        public updateData(arg1: string, arg2: ItemData, arg3: int, arg4: Boolean=true): void
        {
            if (arg4) 
            {
                this._titleTxt.htmlText = arg1;
                this._titleTxt.x = (this.width - this._titleTxt.textWidth) / 2;
                this._valueTxt.htmlText = HTMLUtil.addColor(Language.getString(26306) + "：", GlobalStyle.color1) + HTMLUtil.addColor(arg3.toString(), "#ffff00");
                this._valueTxt.x = (this.width - this._valueTxt.textWidth) / 2;
            }
            else 
            {
                this._titleTxt.htmlText = "";
                this._valueTxt.htmlText = "";
            }
            this._itemBase.itemData = arg2;
            if (this._cur) 
            {
                this._itemBase.toolTipType = ItemData.ToolTipType_Forge;
                this._itemBase.toolTipData = arg2.getToolTipData(ItemData.ToolTipType_Forge);
            }
            else 
            {
                this._itemBase.toolTipType = ItemData.ToolTipType_Pack;
                this._itemBase.toolTipData = arg2.getToolTipData();
            }
            return;
        }

        public dispose(): void
        {
            this._titleTxt.text = "";
            this._valueTxt.text = "";
            this._itemBase.itemData = null;
            this._itemBase.toolTipData = null;
            return;
        }

        public onGradeEffect(): void
        {
            EffectManager.glowFilterReg(this._valueBody, null, 3, 10, 0, 3);
            return;
        }

        public /* override */ get width(): number
        {
            return 50;
        }

        protected /* var */_titleTxt: Object /* flash.text.TextField */;

        protected /* var */_itemBg: Object /* flash.display.Bitmap */;

        protected /* var */_itemBase: BaseItem;

        protected /* var */_valueBody: Object /* flash.display.Sprite */;

        protected /* var */_valueTxt: Object /* flash.text.TextField */;

        protected /* var */_cur: Boolean;
    }
